<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:doc="livcos.org/ns/doc"
  xmlns:f="livcos.org/ns/xslt/function"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns="http://www.w3.org/1999/XSL/Format"
  xmlns:v="livcos.org/ns/view"
  exclude-result-prefixes="doc f xs v">

	<xsl:import href="../../../../base.xsl"/>
	<xsl:import href="history.xsl"/>
	<xsl:import href="outline.xsl"/>
	<xsl:import href="inline.xsl"/>
	<xsl:import href="image.xsl"/>
	<xsl:import href="link.xsl"/>
	<xsl:import href="list.xsl"/>
	<xsl:import href="table.xsl"/>
	<xsl:import href="markup.xsl"/>
	<xsl:import href="embedding.xsl"/>
	<xsl:import href="journal.xsl"/>
	
	<xsl:template match="/doc:document | /doc:flyer">
		<root id="{f:object-id(.)}">
			<xsl:apply-templates select="doc:head"/>
			<xsl:apply-templates select="doc:history"/>
			<xsl:apply-templates select="doc:body/*"/>
		</root>
	</xsl:template>
	
	<xsl:template match="doc:head">
		<v:head>
			<v:context><xsl:value-of select="doc:context"/></v:context>
			<v:title><xsl:value-of select="doc:title"/></v:title>
			<v:author><xsl:value-of select="../doc:history/doc:record[1]/@author"/></v:author>
			<v:last-modified><xsl:value-of select="../doc:history/doc:record[last()]/@time"/></v:last-modified>
			<v:keywords><xsl:value-of select="doc:keywords"/></v:keywords>
		</v:head>
	</xsl:template>
	
</xsl:stylesheet>
